package com.ek.kademlia.protocol.impl;

import java.io.Serializable;

import com.ek.kademlia.protocol.StoreRequest;

public class DefaultStoreRequest implements StoreRequest {
    private static final long serialVersionUID = 288946017310176391L;
    private byte[] messageID;
    private byte[] nodeID;
    private String key;
    private Serializable value;

    public void setMessageID(byte[] messageID) {
        this.messageID = messageID;
    }

    public byte[] getMessageID() {
        return messageID;
    }

    public void setNodeID(byte[] nodeID) {
        this.nodeID = nodeID;
    }

    public byte[] getNodeID() {
        return nodeID;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getKey() {
        return key;
    }

    public void setValue(Serializable value) {
        this.value = value;
    }

    public Serializable getValue() {
        return value;
    }

    public String getMessageClass() {
        return StoreRequest.class.getCanonicalName();
    }
    
    @Override
    public String toString() {
        return new StringBuilder().
        append("DefaultStoreRequest {\n").
        append("key:" + key + "\n").
        append("value:" + value + "\n").
        append("}\n").
        toString();
    }

}
